package com.zzx.auth.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 用户信息表
 */
public class SysUser implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 用户ID
     */
    @TableId
    private String userId;

    /**
     * 归属部门ID
     */
    private Long deptId;

    /**
     * 用户账号
     */
    private String userName;

    /**
     * 员工职位
     * */
    private String position;

    /**
     * 部门名称
     */
    @TableField(exist = false)
    private String deptName;

    /**
     * 密码
     */
    private String password;

    /**
     * 原密码
     */
    @TableField(exist = false)
    private String rawPassword;

    /**
     * 重复密码
     */
    @TableField(exist = false)
    private String repeatThePassword;

    /**
     * 用户昵称
     */
    @NotEmpty(message = "员工名不能为空")
    private String nickName;

    /**
     * 用户类型（参考枚举）
     * UserTypeEnum
     */
    private Integer userType;

    /**
     * 手机号码
     */
    @NotEmpty(message = "手机号不能为空")
    @Pattern(regexp = "^1\\d{10}$", message = "电话号码格式有误！")
    private String phone;

    /**
     * 身份证
     */
    private String cardNumber;

    /**
     * 用户性别（1男 0女 2未知）
     */
    private Boolean sex;

    /**
     * 头像地址
     */
    private String avatar;

    /**
     * 帐号状态（参考枚举）
     */
    private Integer status;

    /**
     * 删除标志（0代表存在 1代表删除）
     */
    private boolean delFlag;

    /**
     * 最后登陆IP
     */
    private String loginIp;

    /**
     * 最后登陆时间
     */
    private Date loginDate;

    /**
     * 创建者
     */
    private String createBy;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新者
     */
    private String updateBy;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 备注
     */
    private String remark;

    /**
     * 用户拥有的角色
     */
    @TableField(exist = false)
    private List<Long> roleId;
    /**
     * 用户角色信息
     */
    @TableField(exist = false)
    private List<SysRole> roles;


    public List<SysRole> getRoles() {
        return roles;
    }

    public void setRoles(List<SysRole> roles) {
        this.roles = roles;
    }

    public String getRawPassword() {
        return rawPassword;
    }

    public void setRawPassword(String rawPassword) {
        this.rawPassword = rawPassword;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    public List<Long> getRoleId() {
        return roleId;
    }

    public void setRoleId(List<Long> roleId) {
        this.roleId = roleId;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }
    public Long getDeptId() {
        return deptId;
    }

    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }
    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }
    public Integer getUserType() {
        return userType;
    }

    public void setUserType(Integer userType) {
        this.userType = userType;
    }
    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }
    public String getCardNumber() {
        return cardNumber;
    }

    public void setCardNumber(String cardNumberr) {
        this.cardNumber = cardNumberr;
    }
    public Boolean getSex() {
        return sex;
    }

    public void setSex(Boolean sex) {
        this.sex = sex;
    }
    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }
    public boolean getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(boolean delFlag) {
        this.delFlag = delFlag;
    }
    public String getLoginIp() {
        return loginIp;
    }

    public void setLoginIp(String loginIp) {
        this.loginIp = loginIp;
    }
    public Date getLoginDate() {
        return loginDate;
    }

    public void setLoginDate(Date loginDate) {
        this.loginDate = loginDate;
    }
    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }
    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getRepeatThePassword() {
        return repeatThePassword;
    }

    public void setRepeatThePassword(String repeatThePassword) {
        this.repeatThePassword = repeatThePassword;
    }

    @Override
    public String toString() {
        return "SysUser{" +
        "userId=" + userId +
        ", deptId=" + deptId +
        ", userName=" + userName +
        ", password=" + password +
        ", nickName=" + nickName +
        ", userType=" + userType +
        ", phone=" + phone +
        ", cardNumber=" + cardNumber +
        ", sex=" + sex +
        ", avatar=" + avatar +
        ", status=" + status +
        ", delFlag=" + delFlag +
        ", loginIp=" + loginIp +
        ", loginDate=" + loginDate +
        ", createBy=" + createBy +
        ", createTime=" + createTime +
        ", updateBy=" + updateBy +
        ", updateTime=" + updateTime +
        ", repeatThePassword=" + repeatThePassword +
        ", remark=" + remark +
        "}";
    }

}
